package system

import (
	"counter-help/admin/server/middleware"

	"github.com/gin-gonic/gin"
)

type UUIDLicenseRouter struct{}

func (s *UUIDLicenseRouter) InitUUIDLicenseRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
	uuidRouter := Router.Group("uuid").Use(middleware.OperationRecord())
	uuidRouterWithoutRecord := RouterPub.Group("uuid")
	{
		uuidRouter.GET("list", uuidLicenseApi.GetUUIDList)                      // 获取UUID列表
		uuidRouter.POST("create", uuidLicenseApi.CreateUUIDLicense)             // 创建UUID许可证
		uuidRouter.POST("renew", uuidLicenseApi.RenewUUID)                      // 续费UUID许可证
		uuidRouter.POST("update", uuidLicenseApi.UpdateUUIDLicense)             // 更新UUID许可证
		uuidRouter.DELETE("delete", uuidLicenseApi.DeleteUUIDLicense)           // 删除UUID许可证
		uuidRouter.GET("renewal-records", uuidLicenseApi.GetUUIDRenewalRecords) // 获取UUID续费记录
		uuidRouter.GET("export-data", uuidLicenseApi.GetUUIDExportData)         // 获取UUID导出数据（包含续费信息）
		uuidRouter.POST("reset-daily-access", uuidLicenseApi.ResetDailyAccess)  // 手动重置所有UUID的当日访问次数
	}
	{
		uuidRouterWithoutRecord.GET("validate", uuidLicenseApi.ValidateUUID) // 验证UUID
	}
}
